//
//  OneViewController.m
//  UI19_豆瓣UICollectionView
//
//  Created by apple on 16/1/29.
//  Copyright © 2016年 King. All rights reserved.
//

#import "OneViewController.h"

#import "UIImageView+WebCache.h"

@interface OneViewController ()

@end

@implementation OneViewController

- (instancetype)initWithDataModel:(TwoModel *)two
{
    self = [super init];
    if (self) {
        
        self.twoModel = two;
        
    }
    return self;
}



- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [self.inmgeViewModel sd_setImageWithURL:[NSURL URLWithString:self.twoModel.imagesModel.large]];
    self.titleLable.text = self.twoModel.title;
    self.ratLable.text = self.twoModel.rating;
    self.pubLable.text = self.twoModel.pubdate;
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = self.view.frame;
    
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:button];
    
    
    
}


- (void)buttonAction:(UIButton *)button {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
